package cn.tudu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo03 {
    public static void main(String[] args) {
        try ( Connection conn =DBUtils.getConn()){
           String sql ="select id,name,money from hero";
            Statement s=conn.createStatement();
            ResultSet rs =s.executeQuery(sql);
            while(rs.next()){
                int id =rs.getInt(1);
                String name =rs.getString(2);
                int money =rs.getInt(3);
                System.out.println(id+":"+name+":"+money);
            }
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
